package com.hjx.movie.core.system.controller.commons;

import com.hjx.movie.common.utils.Result;
import com.hjx.movie.core.system.service.commons.mail.MailService;
import com.hjx.movie.core.system.vo.MailMsgVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * <p>Title:</p>
 * <p>Description:</p>
 *
 * @author hjx
 * @date 2021/2/1 - 23:15
 */
@RestController
@Slf4j
@RequestMapping("/mail")
public class MailController {
    @Resource
    MailService mailService;
    @PostMapping("/getCaptcha")
    public Result getCaptcha(@RequestBody @Valid MailMsgVO mailMsgVO){
        mailService.sendMailCode(mailMsgVO);
        return Result.success("验证码获取成功，请查看您的邮箱");
    }
}
